package com.example.webcomen.Model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.sql.Timestamp;

@Data
@TableName("t_add_message")
//添加信息
public class AddMessage {
    @TableId
    private Integer id;

    @TableField("from_uid")
    private Integer fromUid;

    @TableField("to_uid")
    private Integer toUid;

    @TableField("group_id")
    private Integer groupId;

    private String remark;
    private Integer agree;
    private Integer type;
    private Timestamp time;

    public AddMessage() {
    }

    public AddMessage(Integer fromUid, Integer toUid, Integer groupId, String remark , Integer type, Timestamp time) {

        this.fromUid = fromUid;
        this.toUid = toUid;
        this.groupId = groupId;
        this.remark = remark;
        this.type = type;
        this.time = time;
    }
/*
*   `id` int(10) NOT NULL AUTO_INCREMENT,
  `from_uid` int(10) NOT NULL COMMENT '谁发起的请求',
  `to_uid` int(10) NOT NULL COMMENT '发送给谁的申请,可能是群，那么就是创建该群组的用户',
  `group_id` int(10) NOT NULL COMMENT '如果是添加好友则为from_id的分组id，如果为群组则为群组id',
  `remark` varchar(255) DEFAULT NULL COMMENT '附言',
  `agree` tinyint(2) NOT NULL DEFAULT '0' COMMENT '0未处理，1同意，2拒绝',
  `type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '类型，可能是添加好友或群组',
  `time` datetime NOT NULL COMMENT '申请时间',
* */
}
